﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DLTN.Entities;
using DLTN.Data;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for BindCatalog
/// </summary>
public class BindCatalog
{
	public BindCatalog()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static void BindLoaiChuyenMuc(DropDownList cboCatalog)
    {
        TList<LoaiChuyenMuc> TList_Catalog = DataRepository.LoaiChuyenMucProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenLoaiChuyenMuc";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Loại chuyên mục --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindLoaiTour(DropDownList cboCatalog)
    {
        TList<LoaiTour> TList_Catalog = DataRepository.LoaiTourProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenLoaiTour";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Loại tour --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindSubChuyenMuc(DropDownList cboCatalog)
    {
        TList<SubChuyenMuc> TList_Catalog = DataRepository.SubChuyenMucProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenSubChuyenMuc";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Sub chuyên mục --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindSubTour(DropDownList cboCatalog)
    {
        TList<SubTour> TList_Catalog = DataRepository.SubTourProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenSubTour";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Sub tour --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindBoSuuTap(DropDownList cboCatalog)
    {
        TList<BoSuuTap> TList_Catalog = DataRepository.BoSuuTapProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "Ten";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Bộ sưu tập --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindNoiDen(DropDownList cboCatalog)
    {
        TList<NoiDen> TList_Catalog = DataRepository.NoiDenProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenNoiDen";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Nơi đến --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindNoiDi(DropDownList cboCatalog)
    {
        TList<NoiDi> TList_Catalog = DataRepository.NoiDiProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenNoiDi";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Nơi đi --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindGiaTour(DropDownList cboCatalog)
    {
        TList<GiaTour> TList_Catalog = DataRepository.GiaTourProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "SoTien";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Số tiền --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindHangMayBay(DropDownList cboCatalog)
    {
        TList<HangMayBay> TList_Catalog = DataRepository.HangMayBayProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenHangMayBay";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Hãng máy bay --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindTenXe(DropDownList cboCatalog)
    {
        TList<VanChuyen> TList_Catalog = DataRepository.VanChuyenProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "TenXe";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Tên xe --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindNhaSanXuat(DropDownList cboCatalog)
    {
        TList<VanChuyen> TList_Catalog = DataRepository.VanChuyenProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "NhaSanXuat";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
        ListItem ItemChoose = new ListItem();
        ItemChoose.Text = " -- Nhà sản xuất --";
        ItemChoose.Value = "0";
        cboCatalog.Items.Insert(0, ItemChoose);
    }
    public static void BindGioiTinh(DropDownList cboCatalog)
    {
        TList<GioiTinh> TList_Catalog = DataRepository.GioiTinhProvider.GetAll();
        cboCatalog.DataSource = TList_Catalog;
        cboCatalog.DataTextField = "GioiTinh";
        cboCatalog.DataValueField = "Id";
        cboCatalog.DataBind();
    }
    /// <summary>
    /// THANHLT them vao
    /// # 2013/07/23
    /// # Booking
    /// </summary>
    /// <param name="cboLoaiKhach"></param>
    public static void BindLoaiKhach(DropDownList cboLoaiKhach)
    {
        TList<LoaiKhach> TList_LoaiKhach = DataRepository.LoaiKhachProvider.GetAll();
        cboLoaiKhach.DataSource = TList_LoaiKhach;
        cboLoaiKhach.DataTextField = "TenLoaiKhach";
        cboLoaiKhach.DataValueField = "Id";
        cboLoaiKhach.DataBind();
    }

    public static void BindLoaiTuoi(DropDownList cboLoaiTuoi)
    {
        TList<LoaiTuoi> TList_LoaiTuoi = DataRepository.LoaiTuoiProvider.GetAll();
        cboLoaiTuoi.DataSource = TList_LoaiTuoi;
        cboLoaiTuoi.DataTextField = "DoTuoi";
        cboLoaiTuoi.DataValueField = "Id";
        cboLoaiTuoi.DataBind();
    }

    public static void BindPhongDon(DropDownList cboPhongDon)
    {
        cboPhongDon.Items.Clear();
        ListItem item1 = new ListItem();
        item1.Text = "Có";
        item1.Value = "1";
        ListItem item2 = new ListItem();
        item2.Text = "Không";
        item2.Value = "0";

        cboPhongDon.Items.Insert(0, item1);
        cboPhongDon.Items.Insert(1, item2);
    }
    ///
    // END
    ///

    public static void BindMailLienHe(DropDownList cboMail)
    {
        cboMail.Items.Clear();
        ListItem item1 = new ListItem();
        item1.Text = " -- Liên Hệ -- ";
        item1.Value = "0";
        ListItem item2 = new ListItem();
        item2.Text = "Ban Giám đốc";
        item2.Value = "1";

        ListItem item3 = new ListItem();
        item3.Text = "Truyền thông";
        item3.Value = "2";

        ListItem item4 = new ListItem();
        item4.Text = "Sales Nội Địa";
        item4.Value = "3";

        ListItem item5 = new ListItem();
        item5.Text = "Sales Outbound";
        item5.Value = "4";

        ListItem item6 = new ListItem();
        item6.Text = "Kế toán";
        item6.Value = "5";

        cboMail.Items.Insert(0, item1);
        cboMail.Items.Insert(1, item2);
        cboMail.Items.Insert(2, item3);
        cboMail.Items.Insert(3, item4);
        cboMail.Items.Insert(4, item5);
        cboMail.Items.Insert(5, item6);
        
    }
}